import redis

r = redis.Redis(
  host='national-cobra-39936.upstash.io',
  port=6379,
  password='AZwAAAIncDFjMTg3ZTIzMWNmYzQ0NGI3YWM1MzlkMGU2Mzg2MmI0YXAxMzk5MzY',
  ssl=True
)

r.set('foo', 'bar')
print(r.get('foo'))